package com.ttj.controller.purchaser;


import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.ttj.domain.oracle.OrderSell;
import com.ttj.service.OrderSellService;
import com.ttj.vo.BaseRes;
import com.ttj.vo.OrderSellVo;

/**
 * 兑换管理模块
 * 
 * @author ASia
 *
 */
@Controller
@RequestMapping("purchaser/orderSell")
public class OrderSellController {

	private static Logger logger = LoggerFactory.getLogger(OrderSellController.class);
	
	@Autowired
	private OrderSellService orderSell;

	@RequestMapping(value = "/home", method = RequestMethod.GET)
	@ResponseBody
	public BaseRes<OrderSellVo> index(String username) {
		logger.debug(username);
		return orderSell.index(username);
	}

	@RequestMapping(value = "/sellList", method = RequestMethod.GET)
	@ResponseBody
	public BaseRes<List<OrderSell>> sellList(String username,Integer oStatus) {
		logger.debug(username,oStatus);
		return orderSell.orderSellList(username, oStatus);
	}

	@RequestMapping(value = "/sellDetail", method = RequestMethod.GET)
	@ResponseBody
	public BaseRes<List<OrderSell>> sellDetail(Long orderId,Integer oStatus) {
		logger.debug("{}",orderId,oStatus);
		return orderSell.getOrderSellDetail(orderId,oStatus);
	}
	
	@RequestMapping(value="/reply",method=RequestMethod.GET)
	@ResponseBody
	public int reply(Long orderId){
		logger.debug("{}",orderId);
		return orderSell.reply(orderId);
	}
	
	@RequestMapping(value="/delivery",method=RequestMethod.GET)
	@ResponseBody
	public int delivery(Long orderId){
		logger.debug("{}",orderId);
		return orderSell.delivery(orderId);
	}
}
